home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
telecomm
/
bbsxdemo.lzh
/
OE
/
OE.SCR
< prev
next >
Wrap
Text File
|
1993-01-03
|
16KB
|
591 lines
script
; Online Order Entry System for BBS Express! ST
; written by Keith Ledbetter 14-Sept-87
; ---------------------------------------------
abort off
clear screen
define Top_Of_Page ;item # at top of screen
define Total_items
define Instr ;generic input field
define Count
define Temp
define Pointer ;generic pointer field
define Text_Path = 'd:\bbsxdemo\oe\dat\' ;where the text is
define orders_filename = 'd:\bbsxdemo\oe\dat\orders.dat' ;orders dataset
define info_filename = 'd:\bbsxdemo\oe\dat\info.dat' ;info dataset
define Allow_MasterCard = 'YES' ;change these to the <<--------
define Allow_VISA = 'YES' ; credit cards you want to
define Allow_AMExpress = 'YES' ; allow.. ('YES' or 'NO')
define Allow_COD = 'YES' ; >>> NOTE: NOT IN USE YET!
define Datafile ;the data file we're reading now
define Return_To ;file to execute when done
define product ;the product they are ordering
define quantity ;quantity they want
define name ;to ship to
define address
define city
define state
define zip_code
define day_phone
define night_phone
define payment_type
define acct_number ;(if charge)
define exp_date ;card's expiration date
define bank_name ;bank name
define bank_number ;bank number (if Mastercard)
define spec_instr ;special instructions
define video_width = '&11' ;user's video width
define current_time = '&23' ;timestamp
define current_date = '&24' ;datestamp
define price
define already_asked ;already asked for info?
[name] = &2 ;user's REAL name (from logon record)
[address] = &4
[city] = &5
[state] = &6
[zip_code] = &7
[day_phone] = &8
[night_phone] = &8
; Process the category selection
; ------------------------------
get_category:
[top_of_page] = 1 ; to top of file..
clear screen
clear table
total_items = table_load ('[text_path]category.dat')
if total_items = 0 then
printe 'Sorry...that area is being built!'
exit
endif
GC_main_loop:
clear screen
printe
printe '--------------------------------------' center
printe ' DEMO VERSION! MAY NOT BE UP TO DATE! ' center
printe '--------------------------------------' center
PRINTE
printe '-------------------------------------' center
printe ' # Product Category Selection ' center
printe '-------------------------------------' center
gosub get10_items ;get a page worth of data
printe
GC_re_get:
print 'P)rev N)ext Q)uit #) To View: ' center
input [instr] 2
if [instr] = '' then
increase [top_of_page] 10
goto GC_main_loop
ef [instr] = NUMERIC then
goto get_cat_selection
ef [instr] = 'N' then
increase [top_of_page] 10
goto GC_main_loop
ef [instr] = 'P' then
decrease [top_of_page] 10
goto GC_main_loop
ef [instr] = 'Q' then
exit
else
goto GC_re_get
endif
get_cat_selection:
if [instr] < 1
goto GC_re_get
ef [instr] > [total_items]
goto GC_re_get
endif
datafile = table_get(instr)
datafile = copy (datafile, 36, 12)
top_of_page = 1 ; to top of file..
goto process_items
process_items:
if file_exists ('[text_path][datafile]')
else
get_out:
printe '\n\nSorry, that area is under construction!'
print '\nPress return...'
input [instr] 1
leave:
close
goto Get_category
endif
total_items = table_load ('[text_path][datafile]')
if [total_items] = 0
goto get_out
endif
clear screen
PI_main_loop:
clear screen
printe
printe '-------------------------------------' center
printe ' # Product Price ' center
printe '-------------------------------------' center
gosub get10_items ;get a page worth of data
printe
re_get:
print 'P)rev N)ext Q)uit #) To View: ' center
input [instr] 2
if [instr] = '' then
increase [top_of_page] 10
goto PI_main_loop
ef [instr] = NUMERIC then
goto info
ef [instr] = 'N' then
increase [top_of_page] 10
goto PI_main_loop
ef [instr] = 'P' then
decrease [top_of_page] 10
goto PI_main_loop
ef [instr] = 'Q' then
goto leave
else
goto re_get
endif
info:
if [instr] < 1
goto re_get
ef [instr] > [total_items]
goto re_get
endif
instr = table_get (instr)
if video_width = 40 then
temp = copy (instr, 36, 12)
else
temp = copy (instr, 50, 12)
endif
if file_exists ('[text_path][temp]')
clear screen
view ('[text_path][temp]')
else
PrintE
PrintE 'No info available on that product' center
endif
print '\n\n'
if video_width = 40 then
print '(O)rder (R)equest info (C)ont: ' center
else
print '(O)rder this product (R)equest info on this product (C)ont: ' center
endif
input [temp] 1
if [temp] = 'O'
goto go_order
ef [temp] = 'R'
goto go_info
endif
goto PI_main_loop
go_order:
product = copy (instr, 1, 26)
price = copy (instr, 28, 6)
goto Process_order
go_info:
product = copy (instr, 1, 26)
price = copy (instr, 28, 6)
goto Process_info
get10_items:
if [top_of_page] < 1 then
[top_of_page] = 1
endif
set [pointer] = [top_of_page] + 9
if [pointer] > [total_items] then
set [top_of_page] = [total_items] - 9
endif
if [top_of_page] < 1 then
[top_of_page] = 1
endif
set [pointer] = [top_of_page]
set [count] = 1
get10a:
instr = table_get (pointer)
if [instr] = '' then
set [instr] = ' '
expand [instr] 35
endif
instr = copy (instr, 1, 33)
set [temp] = [pointer]
if [temp] < 10
set [temp] = ' [temp]'
endif
printe '[temp]. [instr]' center
increase [pointer]
increase [count]
if [pointer] > [total_items] then
printe
printe '*** End of Products ***' Center
ef [count] < 11 then
goto get10a
endif
RETURN
Process_Order:
abort off
clear screen
printe '\n\nORDERING: [product]'
printe ' PRICE: [price]\n'
printe '\iNOTE:\o'
if [video_width] = 40 then
printe ' You MUST leave 2 valid voice numbers,'
printe 'since we will validate this order by'
printe ' a telephone call!'
printe
printe ' Credit Card Purchases REQUIRE a'
printe ' $40 minimum order.!'
printe
printe ' IF THE ORDER FORM IS NOT TOTALLY'
printe ' FILLED OUT, IT WILL BE IGNORED!'
printe
printe ' There is a $4.00 minimum shipping'
printe ' charge on your total order.'
printe
printe ' You can ABORT this order at ANY time'
printe 'by entering "ABORT" at the main prompt.'
else
printe 'You MUST leave 2 valid voice numbers, since we will'
printe 'validate this order by a telephone call!'
printe
printe ' Credit Card Purchases REQUIRE a $40 minimum order.!'
printe
printe ' IF THE ORDER FORM IS NOT TOTALLY FILLED OUT, IT WILL BE IGNORED!'
printe
printe ' There is a $4.00 minimum shipping charge on your total order.'
printe
print ' You can ABORT this order at ANY time '
printe 'by entering "ABORT" at the main prompt.'
endif
printe
print 'Press <return> to fill out order form..'
input [instr] 5
if [instr] = 'abort'
goto GO_done
endif
set [quantity] = '(not yet entered)'
set [payment_type] = '(not yet entered)'